const app = getApp();
const Controller = require('../controllers/controllers.js').controller;

Page({
  data: {
    type:0,
  },
  onLoad(option) {
    
  },

  tabs(e){
    this.setData({
      type:e.currentTarget.dataset.type,
    })
    wx.setStorageSync('role',this.data.type)
  },
  golink(e){
    if(this.data.type==0){
      wx.showToast({
          title: "请选择您的身份",
          icon: 'none',
          duration: 1200,
          mask: true
      });
      return
    }

    Controller.updateRoleType({
      roleType:this.data.type
    }).then(res => {
      
    }).catch(res=>{
      console.log(res)
    })
    
    var url=e.currentTarget.dataset.url;
    wx.navigateTo({
      url:e.currentTarget.dataset.url
    });
  },
})